//
//  UIView+category.swift
//  FirstSwiftProduct
//
//  Created by 范泽华 on 2017/10/10.
//  Copyright © 2017年 范泽华. All rights reserved.
//

import UIKit

extension UIView {
    
//    let y:CGFloat;
    
    public var x: CGFloat {
        get {
            return self.frame.origin.x
        }
        set {
            var rect = self.frame
            rect.origin.x = newValue
            self.frame = rect;
        }
    }
    
    public var y: CGFloat {
        get {
            return self.frame.origin.y
        }
        set {
            var rect = self.frame
            rect.origin.y = newValue
            self.frame = rect
        }
    }
    
    public var kwidth:CGFloat{
        get{
            return self.frame.size.width
        }
        set{
            var rect = self.frame
            rect.size.width = newValue
            self.frame = rect
        }
    }
    public var kheight: CGFloat {
        get {
            return self.frame.size.height
        }
        set {
            var rect = self.frame
            
            rect.size.height = newValue
            self.frame = rect
        }
    }
    
    public var kcenterX: CGFloat {
        get {
            return self.center.x
        }
        set {
            var point = self.center
            point.x = newValue
            self.center = point
        }
    }
    
    public var kcenterY: CGFloat {
        get {
            return self.center.y
        }
        set {
            var point = self.center
            point.y = newValue
            self.center = point
        }
    }
    
    
}
